﻿// <copyright file="LoadSociologicalDataStep.cs" company="QUT">
//     Copyright (c) QUT. All rights reserved.
// </copyright>

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GenerateKml.Steps
{
    /// <summary>
    /// Load Sociological Data Step
    /// </summary>
    public partial class LoadSociologicalDataStep : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="LoadSociologicalDataStep"/> class.
        /// </summary>
        public LoadSociologicalDataStep()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets the sociological data file path.
        /// </summary>
        /// <value>The sociological data file path.</value>
        public string SociologicalDataFilePath
        {
            get
            {
                return this.SociologicalDataFileTextBox.Text;
            }
        }

        /// <summary>
        /// Gets the mapping data file path.
        /// </summary>
        /// <value>The mapping data file path.</value>
        public string MappingDataFilePath
        {
            get
            {
                return this.MappingTextBox.Text;
            }
        }

        /// <summary>
        /// Gets the results 2004 data file path.
        /// </summary>
        /// <value>The results 2004 data file path.</value>
        public string Results2004DataFilePath
        {
            get
            {
                return this.Results2004TextBox.Text;
            }
        }

        /// <summary>
        /// Gets the results 2006 data file path.
        /// </summary>
        /// <value>The results 2006 data file path.</value>
        public string Results2006DataFilePath
        {
            get
            {
                return this.Results2006TextBox.Text;
            }
        }

        /// <summary>
        /// Gets the two party preferred 2004 data file path.
        /// </summary>
        /// <value>The two party preferred 2004 data file path.</value>
        public string TwoPartyPreferred2004DataFilePath
        {
            get
            {
                return this.TwoPartyPreferred2004TextBox.Text;
            }
        }

        /// <summary>
        /// Handles the Click event of the BrowseSociologicalDataFileButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BrowseSociologicalDataFileButton_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "Excel File (*.xls)|*.xls|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.SociologicalDataFileTextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }

        /// <summary>
        /// Handles the Click event of the MappingButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void MappingButton_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "Excel File (*.xls)|*.xls|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.MappingTextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }

        /// <summary>
        /// Handles the Click event of the Results2004Button control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Results2004Button_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "Excel File (*.xls)|*.xls|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.Results2004TextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }

        /// <summary>
        /// Handles the Click event of the Results2006Button control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Results2006Button_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "Excel File (*.xls)|*.xls|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.Results2006TextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }

        /// <summary>
        /// Handles the Click event of the BrowseTwoPartyPreferred2004Button control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void BrowseTwoPartyPreferred2004Button_Click(object sender, EventArgs e)
        {
            this.MainOpenFileDialog.Filter = "Data File (*.csv)|*.csv|All files (*.*)|*.*";
            this.MainOpenFileDialog.FileName = string.Empty;
            if (this.MainOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                this.TwoPartyPreferred2004TextBox.Text = this.MainOpenFileDialog.FileName;
            }
        }
    }
}
